package com.sitech.portal.webHooks.dao.ibatis;

import com.sitech.ibnms.core.BaseIbnmsDao;
import com.sitech.ibnms.core.IPage;
import com.sitech.ibnms.core.PageForm;
import com.sitech.portal.webHooks.dao.IWebHooksDao;
import com.sitech.portal.webHooks.domain.WebHooks;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class WebHooksDaoImpl extends BaseIbnmsDao implements IWebHooksDao {

    @Override
    public WebHooks selectWebHooks(String id) {
        return (WebHooks)querySingle("selectWebHooks",id);
    }

    @Override
    public IPage selectWebHooksList(HashMap map, PageForm pageForm) {

        return findPage("selectWebHooksList",new HashMap(),pageForm);
    }

    @Override
    public int delWebHooks(ArrayList list) {
        HashMap map = new HashMap();
        map.put("ids",list);
       return  this.delete("delWebHooksList",map);
    }

    @Override
    public void addWebHooks(WebHooks orgInfoSync) {
       this.insert("addWebHooks", orgInfoSync );

    }

    @Override
    public List<WebHooks> selectWebHooksUrl(String kind) {
        HashMap map = new HashMap();
        map.put("kind",kind);
        return this.query("selectWebHooksUrl",map);
    }
}
